<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>编辑页面</title>
</head>
<body>
欢迎你：${currentUser}
<hr>
<form:form action="save" method="post" modelAttribute="returnUser">
    <form:hidden path="id"/>
    <button onclick="a()">增加一行</button>
    <table border="1" cellpadding="20" id="mytable"></table>
    <tr>
        <td>用户名:<input name="username" /></td>
        <td>密码:<input name="password" /></td>
        <td>邮件:<input name="email" /></td>
        <td>联系电话:<input name="phone" /></td>
        <td>职位:<select  name="rolename"/></td>
    <option value="">请选择职位</option>
    <option value="客户经理">客户经理</option>
    <option value="高管">高管</option>
    <option value="销售主管">销售主管</option>
    <option value="系统管理员">系统管理员</option>
     </input><br>
    </tr>
    </table>
    <input type="submit" value="提交"/>
</form:form>
<script>
    function a(){
        var tr=document.createElement("tr");
        var td1=document.createElement("td");
        var td2=document.createElement("td");
        var input1 =document.createElement("input");
        var input2 =document.createElement("input");
        input1.name="email";
        input2.name="phone";
        document.getElementById("mytable").appendChild(tr);
        tr.appendChild(td1);
        tr.appendChild(td2);
        td1.appendChild(input1);
        td2.appendChild(input2);


    }
</script>
</body>
</html>